package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OrgAccbookMapper;
import com.ruoyi.system.domain.OrgAccbook;
import com.ruoyi.system.service.IOrgAccbookService;
import com.ruoyi.common.core.text.Convert;

/**
 * 账簿_核算账簿Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-08
 */
@Service
public class OrgAccbookServiceImpl implements IOrgAccbookService 
{
    @Autowired
    private OrgAccbookMapper orgAccbookMapper;

    /**
     * 查询账簿_核算账簿
     * 
     * @param pkAccbook 账簿_核算账簿主键
     * @return 账簿_核算账簿
     */

    @DataSource(DataSourceType.SLAVE)
    @Override
    public OrgAccbook selectOrgAccbookByPkAccbook(String pkAccbook)
    {
        return orgAccbookMapper.selectOrgAccbookByPkAccbook(pkAccbook);
    }

    /**
     * 查询账簿_核算账簿列表
     * 
     * @param orgAccbook 账簿_核算账簿
     * @return 账簿_核算账簿
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<OrgAccbook> selectOrgAccbookList(OrgAccbook orgAccbook)
    {
        return orgAccbookMapper.selectOrgAccbookList(orgAccbook);
    }

    /**
     * 新增账簿_核算账簿
     * 
     * @param orgAccbook 账簿_核算账簿
     * @return 结果
     */
    @Override
    public int insertOrgAccbook(OrgAccbook orgAccbook)
    {
        return orgAccbookMapper.insertOrgAccbook(orgAccbook);
    }

    /**
     * 修改账簿_核算账簿
     * 
     * @param orgAccbook 账簿_核算账簿
     * @return 结果
     */
    @Override
    public int updateOrgAccbook(OrgAccbook orgAccbook)
    {
        return orgAccbookMapper.updateOrgAccbook(orgAccbook);
    }

    /**
     * 批量删除账簿_核算账簿
     * 
     * @param pkAccbooks 需要删除的账簿_核算账簿主键
     * @return 结果
     */
    @Override
    public int deleteOrgAccbookByPkAccbooks(String pkAccbooks)
    {
        return orgAccbookMapper.deleteOrgAccbookByPkAccbooks(Convert.toStrArray(pkAccbooks));
    }

    /**
     * 删除账簿_核算账簿信息
     * 
     * @param pkAccbook 账簿_核算账簿主键
     * @return 结果
     */
    @Override
    public int deleteOrgAccbookByPkAccbook(String pkAccbook)
    {
        return orgAccbookMapper.deleteOrgAccbookByPkAccbook(pkAccbook);
    }
}
